function doSubmit() {
	var agree = $('#agree').is(":checked");
	if (!agree) {
		swal('注册失败', '请同意许可条款', 'error');
		return false;
	}
	if ($('#username').val().trim() == "") {
		swal('注册失败', '请输入用户名', 'error');
		return false;
	}
	if ($('#email').val().trim() == "") {
		swal('注册失败', '请输入邮箱', 'error');
		return false;
	}
	if ($('#password').val().trim() == "") {
		swal('注册失败', '请输入密码', 'error');
		return false;
	}
	var password = SparkMD5.hash(SparkMD5.hash($('#password').val().trim()));
	var repass = SparkMD5.hash(SparkMD5.hash($('#repass').val()));
	if (password != repass) {
		swal('注册失败', '两次密码输入不一致', 'error');
		return false;
	}
	
	var username = $('#username').val();
	var email = $('#email').val();
	var data = {
		'username': username,
		'email': email,
		'password': password,
		'repass': repass,
		'agree': agree
	};
	
	$.ajax({
		'url': '/user/RegCheck',
		'type': 'POST',
		'dataType': 'JSON',
		'data': data,
		'success': function (ret) {
			console.log(ret);
			if (ret.code == 0 || ret.code == '0'){
				swal('注册成功', '', 'success');
			} else {
				swal('注册失败', ret.msg, 'error');
			}
		}
	});
	return false;
}
$(function (){
	$('input#agree').iCheck({
        checkboxClass: 'icheckbox_square-blue',
        radioClass: 'iradio_square-blue',
        increaseArea: '20%' // optional
    });
})